#!/bin/sh
#
#  zz-runlilo - postrm script for modern kernel management
#
#  Copyright 2010 Joachim Wiedorn
#  All rights reserved.
#
#  Licensed under the terms contained in the file 'COPYING'
#  in the source directory.
#

set -e
PAR=ever

# check for maintainer param
if [ -n "${DEB_MAINT_PARAMS}" ]; then
	PAR=none
	if [ `echo "${DEB_MAINT_PARAMS}" | grep -v abort | grep -c remove` -eq 1 ]
	then PAR=remove; fi
fi

# check for configure|upgrade|remove|purge
case "$PAR" in

  ever|remove)
    # Run the boot loader installer
    if [ -f /sbin/lilo ]; then
      if [ -f /etc/lilo.conf ]; then
        # Do not abort kernel removal in case of error
        lilo  </dev/null  >&2  || true
      fi
    fi
    ;;

esac

# end of file
